<template>
	<view class="container">
		<tkiBarcode
			ref="barcode"
			:show="true"
			format="code128"
			cid="tki-barcode-canvas"
			val="1234567890128"
			unit="upx"
			:options="barcodeOptions"
			:onVal="false"
			:loadMake="true"
			@result="barResult"
		/>
	</view>
</template>

<script>
import useStore from '@/store/index';
import tkiBarcode from '@/components/tkiBarcode/tkiBarcode.vue';
import { barcodeOptions } from './config/index';

export default {
	name: 'CustomTkiBarcode',
	components: {
		tkiBarcode,
	},
	data() {
		return {
			barcodeOptions
		};
	},
	mounted() {
		this.init();
	},
	methods: {
		init() {
			setTimeout(() => {
				this.loading = false;
			}, 2000);
		},
		barResult(e) {
			console.log(e);
		}
	},
};
</script>